package com.example.yls.work_wuziqi;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import cn.bmob.v3.Bmob;

public class MainActivity extends AppCompatActivity {
    private WuziPanel wuziPanel;
    private Button startView;
    private Button lastView;
    private static final int VIEW_CODE = 100;
    private  boolean who = true;
    private int isGameOver;
    private int isWhiterWin;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Bmob.initialize(this, "663dca6db560865a269b189e82c27b37");
        initView();
        lastViews();
    }
    private void lastViews() {
        lastView = findViewById(R.id.last_view);
        lastView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                wuziPanel.lastView();
            }
        });
    }

    private void initView() {
        startView = findViewById(R.id.start_view);
        wuziPanel = findViewById(R.id.wuzipanel);
        startView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                wuziPanel.start();
            }
        });
    }
}
